
package com.rt.schedulebase.dto;

import com.rt.schedulebase.entity.DictUsers;
import com.rt.schedulebase.entity.DictQueueClass;
import com.rt.schedulebase.entity.DictPatientSource;
import com.rt.schedulebase.entity.DictDept;
import com.rt.schedulebase.entity.DictWard;
import lombok.Data;

import java.util.List;
import java.io.Serializable;

/**
 * 预约规则详情实体
 */
@Data
public class RuleDto implements Serializable {
    private String examClass;
    private String regularId;
    private String regularName;
    private String regularMemo;
    private Integer sortNo;
    /**
     * 规则标识
     * 0： 允许
     * 1： 排斥
     */
    private String excludeFlag;
    /**
     * 时段规则类型
     */
    private String rgularType;

    /**
     * 镇静
     */
    private String calm;
    /**
     * 增强
     */
    private String enhance;
    /**
     * 床旁
     */
    private String bedSide;
    private String clinicPath;
    private String criticallyIll;
    private String vip;
    private String indolence;
    private LimitScope sex;
    private LimitScope ward;
    private LimitScope dept;
    /**
     * 优先级别 普通、急诊、特需
     */
    private LimitScope priorityOrder;
    private LimitScope patientSource;
    private LimitScope transTool;
    /**
     * 项目列表
     */
    private LimitScope examItem;
    /**
     * 项目列表
     */
    private LimitScope itemPackage;
    /**
     * 标记为特殊
     */
    private LimitScope specialItem;
    /**
     * 标记为单项特殊
     */
    private LimitScope specialSingleItem;
    /**
     * 标记为多项特殊
     */
    private LimitScope specialMultiItem;
    private AgeScope age;
    private GestationalWeekScope gestationalWeek;
    private String unSchedule;
    private String gestational;
    /**
     * 空腹
     * 0 不做 1 做
     */
    private String emptyStomach;
    /**
     * 憋尿
     * 0 不做 1 做
     */
    private String bernao;
    /**
     * 穿刺
     * 0 不做 1 做
     */
    private String puncture;

    /**
     * 检查项目列表-JSON解析后的数据 examItem、itemPackage
     */
    private List<DictExamItemDto> dictExamItemList;

    /**
     * 病区
     */
    private List<DictWard> dictWardList;
    /**
     * 科室
     */
    private List<DictDept> dictDeptList;
    private List<DictPatientSource> dictPatientSourceList;
    /**
     * 特殊项目
     */
    private SpecialProperty specialProperty;
    private ItemProperty itemProperty;
    /**
     * 运输工具
     */
    private List<String> transToolList;
    private List<DictQueueClass> dictQueueClassList;
    private List<String> patientAttributes;
    private List<ComboBox> patientAttributeList;
    private List<String> terminalTypes;
    private List<ComboBox> terminalTypeList;
    private NumScope numScope;
    private List<DictUsers> dictUsersList;
    private LimitScope reqPhysician;
    private List<String> diagnosticKeywordList;
    private LimitScope diagnosticKeyword;
    private String createDoc;
    private NumScope reqDayScope;
    private LimitScope terminalType;
    private String infectious;
    private String multiDrug;
    private List<DictDept> nurseUnitList;
    /**
     * 护理单元
     */
    private LimitScope nurseUnit;
    private String needToCalm;
    /**
     * 项目个数
     */
    private NumScope itemCountScope;

    /***
     * 限制范围
     */
    @Data
    public static class LimitScope implements Serializable {
        /**
         * 0： 排除 1 包含
         */
        private String grant;
        /**
         * 具体值id或者CODE
         */
        private List<String> value;
    }

    /**
     * 年龄范围
     */
    @Data
    public static class AgeScope implements Serializable {
        /**
         * 0： 排除 1 包含
         */
        private String grant;
        /**
         * 天
         */
        private List<DayScope> dayScope;
        /**
         * 年龄列表
         */
        private List<String> ageScopeList;
        /**
         * 年龄范围 12-18、20-40
         */
        private List<String> ageStrList;
    }

    @Data
    public static class DayScope implements Serializable {
        private Integer min;
        private Integer max;
    }

    /**
     * 经期范围
     */
    @Data
    public static class GestationalWeekScope implements Serializable {
        private String grant;
        private List<DayScope> dayScope;
        private List<String> gestationalWeekScopeList;
        private List<String> gestationalWeekStrList;
    }

    @Data
    public static class SpecialProperty implements Serializable {
        private List<String> onlyDoList;
        private List<String> noDoList;
    }

    @Data
    public static class ItemProperty implements Serializable {
        private List<String> onlyDoList;
        private List<String> noDoList;
    }

    /**
     * 数量范围
     */
    @Data
    public static class NumScope implements Serializable {

        /**
         * 0 排除
         * 1 包含
         */
        private String grant;
        private Integer min;
        private Integer max;
    }

    @Data
    public static class ComboBox implements Serializable {
        private String text;
        private String value;

        public ComboBox() {
        }

        public ComboBox(String value, String text) {
            this.text = text;
            this.value = value;
        }
    }
}
